
#include "movables.h"


Movables::Movables()
{
}


Movables::Movables(Movable_type object_type, int x_loc, int y_loc):
									_type(object_type), 
									_x(x_loc), _y(y_loc), 
									_direction(RIGHT), 
									//_bitmap(Bitmaps::object_bitmap(object_type)), 
									_bitmap(Bitmaps::get_default_bitmap(object_type)),
									_radius(1) 
{
	switch (_type)
	{
		case DIGDUG:  _speed = 1; break;
		case MONSTER: _speed = 2; break;
		case PROJECTILE: _speed = 1; break; 
	}

}

void Movables::set_location(int new_x_loc, int new_y_loc)
{
	_x = new_x_loc;
	_y = new_y_loc;
}


void Movables::set_direction(Direction new_dir)
{
	_direction = new_dir;
}


void Movables::set_status(Status new_status)
{
	_status = new_status;
}


int Movables::x()
{
	return _x;
}
int Movables::y()
{
	return _y;
}

int Movables::radius()
{
	return _radius;
}

Direction Movables::direction()
{
//convert from enumerated type Direction to int
	return _direction;
}
	
int Movables::speed()
{
	return _speed;
}

bool Movables::status()
{
	//convert from enumerated type Status which is either 0 or 1 to type bool
	return static_cast<bool>(_status);  
}

Movable_type Movables::type()
{
//convert from enumerated type Object_type to int
	return _type;
}

ALLEGRO_BITMAP *Movables::bitmap()
{
	return _bitmap;
}
